package org.rescue.analysis.summarize;
import javax.swing.tree.DefaultMutableTreeNode;

/*
 * Contains a pair of candidate nodes to be merged (mergeParent and mergeChild) 
 * among candidates under childNode. If mergeParent == childNode, then merging 
 * is done with the childNode itself. If mergeChild == childNode, then the
 * ChildNode is merged with the current taxonomy concept for which the k best
 * concepts are being computed.
 * 
 *   minloss store the new minloss of childNode that result from this merging. 
 */

public class SMinLossData {
	double minloss;
	double minProbability;
	DefaultMutableTreeNode childCandNode;
	DefaultMutableTreeNode mergeParent;
	DefaultMutableTreeNode mergeChild;

	public SMinLossData() {
		// initialize minloss with a very large number
		minloss = Double.POSITIVE_INFINITY;
		minProbability = Double.POSITIVE_INFINITY;
//		minloss = -1.0;  // in order to force merge on node with k children.
		                // loss in this case is 0.0
	}	

	/**
	 * @return Returns the childNode.
	 */	
	public DefaultMutableTreeNode getChildCandNode() {
		return childCandNode;
	}
	/**
	 * @param childNode The childNode to set.
	 */
	public void setChildCandNode(DefaultMutableTreeNode childNode) {
		this.childCandNode = childNode;
	}
	/**
	 * @return Returns the mergeChild.
	 */
	public DefaultMutableTreeNode getMergeChild() {
		return mergeChild;
	}
	/**
	 * @param mergeChild The mergeChild to set.
	 */
	public void setMergeChild(DefaultMutableTreeNode mergeChild) {
		this.mergeChild = mergeChild;
	}
	/**
	 * @return Returns the mergeParent.
	 */
	public DefaultMutableTreeNode getMergeParent() {
		return mergeParent;
	}
	/**
	 * @param mergeParent The mergeParent to set.
	 */
	public void setMergeParent(DefaultMutableTreeNode mergeParent) {
		this.mergeParent = mergeParent;
	}
	/**
	 * @return Returns the minloss.
	 */
	public double getMinloss() {
		return minloss;
	}
	/**
	 * @param minloss The minloss to set.
	 */
	public void setMinloss(double minloss) {
		this.minloss = minloss;
	}

	public double getMinProbability() {
		return minProbability;
	}

	public void setMinProbability(double minProbability) {
		this.minProbability = minProbability;
	}	
}
